package com.xy.shop.wechat.builder;


import com.xy.shop.wechat.service.BaseWxService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutNewsMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutNewsMessage.Item;


public class NewsBuilder extends AbstractBuilder {

    @Override
    public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage,
                                   BaseWxService service) {

        Item items = new Item();
        items.setTitle("点我领取活动(关注红包哦)");
        items.setDescription("在活动期间关注公众号即可领取关注红包。机不可失，失不再来。小伙伴们抓紧行动吧");
        items.setPicUrl("http://wx.qlogo.cn/mmopen/BRKlFyiayfMOUM0uf1uCgDDqrhxnzeAbQWnwTnNDJs94W5UpMTwpPzYibE8skp0xkd68HKbjPgvxbhpGyk8B9Ac6NQ7ek2Cavp/0");
        // items.setUrl("http://19j1v52321.iok.la/official-accounts/weChatRedPacket/toRedPacketUi.html");
        items.setUrl("www.baidu.com");
        WxMpXmlOutNewsMessage w = WxMpXmlOutNewsMessage.NEWS().addArticle(items).fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser()).build();

        return w;
    }

}
